package com.tg.demo.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tg.demo.entity.Life;
import com.tg.demo.mapper.LifeMapper;
import com.tg.demo.service.LifeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户信息表ServiceImpl
 *
 * @author yuanjin
 */
@Service
public class LifeServiceImpl implements LifeService {
    private static final Logger logger = LoggerFactory.getLogger(LifeServiceImpl.class);

    @Resource
    private LifeMapper lifeMapper;


    @Override
    public List<Life> getListByCondition(Life life) {
        return lifeMapper.getListByCondition(life);
    }

    @Override
    public PageInfo<Life> getListByPage(Life life, Integer page, Integer size) {
        PageHelper.startPage(page, size);
        List<Life> list = this.getListByCondition(life);
        return PageInfo.of(list);
    }
}
